# deepseek api 调用测试

# key = sk-e93b780b1fa34f80a1cd4f84c24dc908

# Please install OpenAI SDK first: `pip3 install openai`
import os
from openai import OpenAI

client = OpenAI(
    api_key="sk-e93b780b1fa34f80a1cd4f84c24dc908",
    base_url="https://api.deepseek.com")

response = client.chat.completions.create(
    model="deepseek-chat",
    messages=[
        {"role": "system", "content": "You are a helpful assistant"},
        {"role": "user", "content": "你是谁"},
    ],
    stream=False
)

print(response.choices[0].message.content)
# 这就可以调用成功了